# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=libsoup
pkgname=('libsoup' 'libsoup-gnome')
pkgver=2.34.1
pkgrel=1
arch=('ppc')
license=('LGPL')
makedepends=('glib2' 'libxml2' 'sqlite3' 'intltool' 'gobject-introspection' \
'libtool' 'glib-networking')
url="http://www.gnome.org"
source=(http://ftp.gnome.org/pub/gnome/sources/${pkgbase}/${pkgver%.*}/${pkgbase}-${pkgver}.tar.bz2)
options=('!emptydirs')
sha256sums=('a2f846af2c4c08e15eacc9879c8c9be4d85f8105f960f96a9ba3dbabd9ee517b')

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"
  ./configure --prefix=/usr --sysconfdir=/etc \
	--localstatedir=/var --disable-static \
	--disable-gtk-doc-html \
	--enable-introspection \
	--disable-tls-check
  make
}

package_libsoup() {
  pkgdesc="GNOME HTTP Library - base library"
  depends=('glib2' 'libxml2' 'glib-networking')

  cd "${srcdir}/${pkgbase}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  rm -f "${pkgdir}"/usr/lib/libsoup-gnome-2.4.*
  rm -f "${pkgdir}/usr/lib/pkg-config/libsoup-gnome-2.4.pc"
  rm -rf "${pkgdir}/usr/include/libsoup-gnome-2.4"
  rm -f "${pkgdir}/usr/lib/girepository-1.0/SoupGNOME-2.4.typelib"
}

package_libsoup-gnome() {
  pkgdesc="GNOME HTTP Library - GNOME libraries"
  depends=("libsoup=${pkgver}" 'libgnome-keyring')

  cd "${srcdir}/${pkgbase}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  rm -f "${pkgdir}"/usr/lib/libsoup-2.4.*
  rm -f "${pkgdir}/usr/lib/pkg-config/libsoup-2.4.pc"
  rm -rf "${pkgdir}/usr/include/libsoup-2.4"
  rm -rf "${pkgdir}/usr/share"
  rm -f "${pkgdir}/usr/lib/girepository-1.0/Soup-2.4.typelib"
}
